﻿
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<html xmlns:th="http://www.thymeleaf.org">
<head>
 	<!-- 包含公共的JSP代码片段 -->
<title>无线点餐平台</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="/detail/style/js/jquery.js"></script>
<script type="text/javascript" src="/detail/style/js/page_common.js"></script>
<link href="/detail/style/css/common_style_blue.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="/detail/style/css/index_1.css" />

	<!--内嵌式的JS-->
	<script type="text/javascript">
		//删除或者激活
		function delOrActivate(del, id)
		{
			if (del === 0) //进行删除
			{
				if (confirm('您确定要删除?'))
				{
					location.href = '/deskDelete/' + id;
				}
			}else if (del === 1) //进行激活
			{
				if (confirm('您确定要激活?'))
				{
					location.href = '/deskActive/' + id;
				}
			}
		}

		//预定或者退桌
		function orderOrCancel(state, id)
		{
			if (state === 0) //进行预定
			{
				if (confirm('您确定要预定?'))
				{
					location.href = '/deskOrder/' + id;
				}
			}else if (state === 1) //进行退桌
			{
				if (confirm('您确定要退桌?'))
				{
					location.href = '/deskCancel/' + id;
				}
			}
		}

	</script>

</head>
<body>
<!-- 页面标题 -->
<div id="TitleArea">
	<div id="TitleArea_Head"></div>
	<div id="TitleArea_Title">
		<div id="TitleArea_Title_Content">
			<img border="0" width="13" height="13" src="/detail/style/images/title_arrow.gif"/> 餐桌列表
		</div>
    </div>
	<div id="TitleArea_End"></div>
</div>


<!-- 过滤条件 -->
<div id="QueryArea">
	<form action="/deskQuery" method="post">
		<input type="text" name="keyword" th:value="${keyword}" placeholder="请输入餐桌名称">
		<input type="submit" value="搜索">
	</form>
</div>


<!-- 主内容区域（数据列表或表单显示） -->
<div id="MainArea">
    <table class="MainArea_Content" cellspacing="0" cellpadding="0">
        <!-- 表头-->
        <thead>
            <tr align="center" valign="middle" id="TableTitle">
				<td>编号</td>
				<td>桌名</td>
				<td>状态</td>
				<td>预定时间</td>
				<td>操作</td>
			</tr>
		</thead>
		<!--显示数据列表-->
        <tbody id="TableData">

			<tr class="TableDetail1" th:each="desk, deskStart: ${desks}">
				<td align="center" th:text="${deskStart.count}"></td>
				<td align="center" th:text="${desk.name}"></td>
				<td align="center" th:text="${desk.state == 0 ? '空闲' : '预定'}"></td>
				<td align="center" th:text="${desk.bookTime}"></td>
				<td align="center">
					<a href="javascript:void(0);" th:onclick="|orderOrCancel(${desk.state}, ${desk.id})|" class="FunctionButton" th:text="${desk.state == 0 ? '预定' : '退桌'}"></a>
					<a href="javascript:void(0);" th:onclick="|delOrActivate(${desk.del}, ${desk.id})|" class="FunctionButton" th:text="${desk.del == 0 ? '删除' : '激活'}"></a>
				</td>
			</tr>

        </tbody>
    </table>

   <!-- 其他功能超链接 -->
	<div id="TableTail" align="center">
		<div class="FunctionButton"><a href="/page_saveDesk">添加</a></div>
    </div>
</div>
</body>
</html>
